Skip to content

chore: improvements to new code connect templates & build setups#742

Merged
cb-ekuersch merged 5 commits into
masterfrom
code-connect-improvements
Jun 5, 2026
Merged

chore: improvements to new code connect templates & build setups#742
cb-ekuersch merged 5 commits into
masterfrom
code-connect-improvements

Conversation

@cb-ekuersch

@cb-ekuersch cb-ekuersch commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What changed? Why?

Biggest improvement here is the refactor to figma template batch files which dramatically reduce the number of files needed to keep code connect mappings for the CDS icon library

Other changes

Rooted in a single discovery: the Figma Code Connect batch JSON
(icons.figma.batch.json) was leaking into published esm/ builds.
Investigation revealed --copy-files in our babel build commands copies
non-compilable files (.json, .md) unconditionally — the babel ignore
list and --no-copy-ignored flag have no effect on them. This led to a
broader audit of what else was slipping through.

Build (esm output)

  • Remove --copy-files --no-copy-ignored from babel build commands in
    web, mobile, common, utils, web-visualization, mobile-visualization,
    web-utils, docusaurus-plugin-kbar, docusaurus-plugin-llm-dev-server,
    and figma-api. None of these packages import non-JS assets at runtime,
    so the flag served no purpose and was copying figma batch JSONs and
    stray READMEs into the published build.

Changelog / version-bump detection

  • Expand DEV_FILES_REGEX in tools/ci/getAffectedPackages.mjs to
    match figma batch files (*.figma.batch.ts/json) and to treat the
    standard test/dev directories (__tests__, __stories__, __mocks__,
    __fixtures__) as dev-only — not just __stories__ as before. This
    means test helpers, fixtures, and perf tests inside those dirs no longer
    falsely flag a package for a changelog entry.

Test runner consistency

  • Switch packages/mobile test target from @nx/jest:jest executor to
    nx:run-commands (jest --maxWorkers=75%, cwd: {projectRoot}),
    making it identical to the web test target.

Perf test relocation

  • Move component-config reassure benchmarks from src/perf/component-config/
    into src/__tests__/perf/component-config/ (web + mobile) so the
    existing **/__tests__/** ignore globs handle them — no special-casing
    needed in babel or tsconfig. Update perf:component-config script paths.
    Note: the script itself remains a known-broken manual benchmark (pre-existing
    rot, unrelated to these changes); tracked in CDS-2196.

Generated with Claude Code

Root cause (required for bugfixes)

UI changes

iOS Old iOS New
old screenshot new screenshot
Android Old Android New
old screenshot new screenshot
Web Old Web New
old screenshot new screenshot

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@cb-heimdall

cb-heimdall commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS ✅ See below

CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 1/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

…fix changelog detection

Rooted in a single discovery: the Figma Code Connect batch JSON
(`icons.figma.batch.json`) was leaking into published `esm/` builds.
Investigation revealed `--copy-files` in our babel build commands copies
non-compilable files (.json, .md) unconditionally — the babel `ignore`
list and `--no-copy-ignored` flag have no effect on them. This led to a
broader audit of what else was slipping through.

Build (esm output)
- Remove `--copy-files --no-copy-ignored` from babel build commands in
  web, mobile, common, utils, web-visualization, mobile-visualization,
  web-utils, docusaurus-plugin-kbar, docusaurus-plugin-llm-dev-server,
  and figma-api. None of these packages import non-JS assets at runtime,
  so the flag served no purpose and was copying figma batch JSONs and
  stray READMEs into the published build.

Changelog / version-bump detection
- Expand `DEV_FILES_REGEX` in `tools/ci/getAffectedPackages.mjs` to
  match figma batch files (`*.figma.batch.ts/json`) and to treat the
  standard test/dev directories (`__tests__`, `__stories__`, `__mocks__`,
  `__fixtures__`) as dev-only — not just `__stories__` as before. This
  means test helpers, fixtures, and perf tests inside those dirs no longer
  falsely flag a package for a changelog entry.

Test runner consistency
- Switch `packages/mobile` test target from `@nx/jest:jest` executor to
  `nx:run-commands` (`jest --maxWorkers=75%`, `cwd: {projectRoot}`),
  making it identical to the web test target.

Perf test relocation
- Move component-config reassure benchmarks from `src/perf/component-config/`
  into `src/__tests__/perf/component-config/` (web + mobile) so the
  existing `**/__tests__/**` ignore globs handle them — no special-casing
  needed in babel or tsconfig. Update `perf:component-config` script paths.
  Note: the script itself remains a known-broken manual benchmark (pre-existing
  rot, unrelated to these changes); tracked in CDS-2196.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
id: 'icon-coinbaseCardProduct-mobile',
id: `icon-${figma.batch.name}-mobile`,
metadata: { nestable: true },
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice improvements

Moving `*.perf-test.tsx` files into `__tests__/` dirs (for correct build
exclusion) caused them to match the `**/__tests__/**` ESLint config block,
which applies the jest plugin including `jest/expect-expect`. Reassure
benchmarks use `measurePerformance` instead of `expect()` by design, so
this rule fires incorrectly on all perf tests.

Adds a `**/*.perf-test.{ts,tsx}` override to turn off `jest/expect-expect`
globally (mirroring the existing migrator override), and removes the now-
redundant inline `// eslint-disable` comments that were previously added
as workarounds in the 21 perf-test files already living in `__tests__/`.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@adrienzheng-cb adrienzheng-cb self-requested a review June 5, 2026 18:47
adrienzheng-cb
adrienzheng-cb previously approved these changes Jun 5, 2026
@cb-ekuersch cb-ekuersch merged commit 1fab16a into master Jun 5, 2026
24 of 26 checks passed
@cb-ekuersch cb-ekuersch deleted the code-connect-improvements branch June 5, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants